<?php
    function query($sql)
    {
        $connection= mysql_connect('localhost', 'root', 'vertrigo');
        mysql_select_db('tdc',$connection);
        $ketqua= mysql_query($sql);
        
        $data= array();
        while($row = mysql_fetch_assoc($ketqua))
        {
            $data[]= $row;
        }
        return $data;
    } ?>